package com.cykj.feign;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MyGoodFeignImpl implements FallbackFactory<GoodFeign> {

    @Override
    public GoodFeign create(Throwable cause) {
       cause.printStackTrace();
        System.out.println("报错了，进入熔断");
        return new GoodFeign() {
            @Override
            public String test() {
                return "hello，进入熔断了，积分稍后赠送";
            }
        };
    }
}
